package com.aodonghao.mapper;

import com.aodonghao.domain.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

public interface StudentMapper {
    @Select("Select * from student")
    List<Student> findAll();
    @Insert("Insert into student values(#{number},#{name},#{birthday},#{address})")
    void save(Student student);
    @Select("Select * from student where number=#{number}")
    Student findByNumber(String number);
    @Update("update student set name=#{name},birthday=#{birthday},address=#{address} where number = #{number}")
    void update(Student student);
    @Delete("delete from student where number=#{number}")
    void delete(String number);

}
